import request from '@/utils/request'

/**
 * 查询下级资源信息
 * @param {*} resId
 */
export function fetchList(resId) {
  return request({
    url: '/base/auth/resource/list',
    method: 'get',
    params: { resId }
  })
}

/**
 * 创建资源
 * @param {*} baseResource
 */
export function createAuthResource(baseResource) {
  return request({
    url: '/base/auth/resource/create',
    method: 'post',
    data: baseResource
  })
}

/**
 * 更新资源信息
 * @param {*} baseResource
 */
export function updateAuthResource(baseResource) {
  return request({
    url: '/base/auth/resource/update',
    method: 'post',
    data: baseResource
  })
}

/**
 * 根据资源ID删除资源
 * @param {*} resId
 */
export function deleteAuthResource(resId) {
  return request({
    url: '/base/auth/resource/delete',
    method: 'post',
    params: { resId }
  })
}
